from appium.webdriver.common.mobileby import MobileBy
from appium.webdriver.webdriver import WebDriver
import logging
from wechat_add.base.base import BasePage

class EditMemberPage(BasePage):
    logging.info("填写姓名")
    logging.info("填写电话号码")
    logging.info("点击保存")
    def editmember(self,name,phone):

        self.find_sendkeys(MobileBy.XPATH, '//*[contains(@text,"姓名")]/../*[@text="必填"]',name)


        self.find_sendkeys(MobileBy.XPATH, '//*[contains(@text,"手机")]/..//*[@text="必填"]',phone)
        #  time.sleep(10)
        #  # 保存

        self.find_click(MobileBy.XPATH, '//*[@text="保存"]')
        from ding.wechat_add.page.addmemberpage import AddMemberPage

        return  AddMemberPage(self.driver)